package com.example.qxfw.nyqx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.ny.AgriWeatherDistRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("service")
public interface AgriWeatherDistRecordMapper extends BaseMapper<AgriWeatherDistRecord> {

    @Select("select affectarea, croparea " +
            "from agri_weather_dist_record " +
            "where cropname='双季晚稻' and stationid='${stationId}' and  '${yield}' between to_char(starttime,'yyyy') and to_char(endtime,'yyyy') ")
    List<AgriWeatherDistRecord> selectList2(String stationId, String yield);

    @Select("select affectarea, croparea " +
            "from agri_weather_dist_record " +
            "where cropname='${cropName}' and stationid='${stationId}' and  '${year}' between to_char(starttime,'yyyy') and to_char(endtime,'yyyy') ")
    List<AgriWeatherDistRecord> selectList1(String cropName,String stationId,long year);

}
